package com.longai.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Picture entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "picture", catalog = "longai")
public class Picture implements java.io.Serializable {

	// Fields

	private Integer pictureId;
	private User user;
	private String picname;
	private Long picturePubtime;
	private String originallurl;
	private String permisson;
	private String nailurl;

	// Constructors

	/** default constructor */
	public Picture() {
	}

	/** minimal constructor */
	public Picture(String picname, Long picturePubtime, String originallurl,
			String permisson, String nailurl) {
		this.picname = picname;
		this.picturePubtime = picturePubtime;
		this.originallurl = originallurl;
		this.permisson = permisson;
		this.nailurl = nailurl;
	}

	/** full constructor */
	public Picture(User user, String picname, Long picturePubtime,
			String originallurl, String permisson, String nailurl) {
		this.user = user;
		this.picname = picname;
		this.picturePubtime = picturePubtime;
		this.originallurl = originallurl;
		this.permisson = permisson;
		this.nailurl = nailurl;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "picture_id", unique = true, nullable = false)
	public Integer getPictureId() {
		return this.pictureId;
	}

	public void setPictureId(Integer pictureId) {
		this.pictureId = pictureId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "picname", nullable = false, length = 45)
	public String getPicname() {
		return this.picname;
	}

	public void setPicname(String picname) {
		this.picname = picname;
	}

	@Column(name = "picture_pubtime", nullable = false)
	public Long getPicturePubtime() {
		return this.picturePubtime;
	}

	public void setPicturePubtime(Long picturePubtime) {
		this.picturePubtime = picturePubtime;
	}

	@Column(name = "originallurl", nullable = false, length = 200)
	public String getOriginallurl() {
		return this.originallurl;
	}

	public void setOriginallurl(String originallurl) {
		this.originallurl = originallurl;
	}

	@Column(name = "permisson", nullable = false, length = 45)
	public String getPermisson() {
		return this.permisson;
	}

	public void setPermisson(String permisson) {
		this.permisson = permisson;
	}

	@Column(name = "nailurl", nullable = false, length = 200)
	public String getNailurl() {
		return this.nailurl;
	}

	public void setNailurl(String nailurl) {
		this.nailurl = nailurl;
	}

}